/**
 * 运行环境
 * @type {[type]}
 */
const env = () => {
    try{
        const systemInfo = wx.getSystemInfoSync();
        const menuButton = wx.getMenuButtonBoundingClientRect();
        const height = menuButton.height + menuButton.top + 6;
        const right = systemInfo.windowWidth - menuButton.right; 

        return Object.assign(systemInfo, {
            NODE_ENV: systemInfo.platform === 'devtools',
            headerInfo: {
                height: height,
                top: menuButton.top,
                bottom: 6,
                right: right,
                paddingRight: (right * 2) + menuButton.width,
                menuHeight: menuButton.height,
                menuWidth: menuButton.width,
            },
        })
    }catch(err){
        console.error(err)
        return {}
    }
}

module.exports = env()
